#include "socket.h"


Socket::Socket(QObject *parent) : QTcpSocket(parent)
{
    connect(this, SIGNAL(readyRead()), this, SLOT(processIncomingData()));
}

qint64 Socket::write(const QByteArray& data){
    return QIODevice::write(data);
}



void Socket::processIncomingData()
{
    QByteArray data = this->readAll();
    Q_EMIT dataReceived(data);
}

